﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace VntNet.PowerSchemeSwitcher
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            if (!IsValidOs())
                throw new InvalidOperationException(string.Format("This application does not run on {0}. Works on Vista and latter",Environment.OSVersion.VersionString));

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new AppContext());
        }
        
        private static bool IsValidOs()
        {
            if (Environment.OSVersion.Platform != PlatformID.Win32NT)
                return false;
            //works only on Vista (6) and greater(win7 6.1) 
            if (Environment.OSVersion.Version.Major < 6)
                return false;
            return true;
        }
    }
}
